#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

void FindDog(int arr[],int sz)
{
   
    int i = 0;
    int ret = 0; 
    int pos = 0;
    for (i = 0; i < sz; i++)
    {
        ret = ret ^ arr[i];
    }

    for (i = 0; i < 32; i++)
    {
        if (((ret >> i) & 1) == 1)
        {
            pos = i;
            break;
        }
    }
    int m = 0;
    int n = 0;
    for (i = 0; i < sz; i++)
    {
        if (1 == ((arr[i] >> pos) & 1))
        {
            m = m ^ arr[i];
        }
        else
        {
            n = n ^ arr[i];
        }
    }
    printf("%d %d", m, n);

  
}





int main()
{
    int arr[] = { 1,2,3,4,5,1,2,3,4,6 };
    int sz = sizeof(arr) / sizeof(arr[0]);
    
    FindDog(arr,sz);
    
    return 0;
}